# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-json-logger
pkgver=2.0.7
pkgrel=3
pkgdesc="A python library adding a json log formatter"
url="https://github.com/madzak/python-json-logger"
arch="noarch"
license="BSD-2-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-v$pkgver.tar.gz::https://github.com/madzak/python-json-logger/archive/v$pkgver.tar.gz
	python-3.12.patch
	"
builddir="$srcdir/"python-json-logger-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b6bdeec2a01257255cd79a7315d01125b2d40fca9fd2cfd2a8beed68ab58aaf1a85e0946c56979904b81341bdaf95f6c879b5661cdd7a17f120a04fa0c0db489  py3-json-logger-v2.0.7.tar.gz
c474c7c8752f87ec9e01a47bec15ad1e00f64db654127be980ad0dc9ed46b0dd249f0f636d5c50ce9c58f707f0c8d50df03412d92596fdd47bb2f54a3c7a246d  python-3.12.patch
"
